import request from './request'
// 登录
export const login = (data) =>{
  return request({
    method: 'post',
    url: 'mall/users/login',
    data,
    dataType: "json"
  })
}
// 退出登录

export const exitUser = (id)=>{
  return request({
    method: 'get',
    url: 'mall/users/quiteLogin',
    params:{
      id
    },
    headers:{
      token:`${localStorage.getItem('token')}`
    }
  })
}
// 获取客户信息
export const getUserInfo = (id) =>{
  return request({
    method: 'get',
    url: 'mall/users/getUserInfo?',
    params:{
      id
    },

  })
}
// 修改客户信息
export const updataUserInfo = (data) =>{
  return request({
    method: 'post',
    url: '/mall/users/updateUsersInfo',
    data,
    dataType: "json",
    headers:{
      token:`${localStorage.getItem('token')}`
    }
  })
}
// 用户修改密码
export const changePasswrod = (data)=>{
  return request({
    method: 'post',
    url: 'mall/users/updatePassword',
    data,
    dataType: "json",
    headers:{
      token:`${localStorage.getItem('token')}`
    }
  })
}
// 用户忘记密码
export const forget = (data)=>{
  return request({
    method: 'post',
    url: 'mall/users/forgetPassword',
    data,
    dataType: "json",
  })
}